package com.ziya.android.a3dmodel.course.one

import android.opengl.GLSurfaceView.Renderer
import com.ziya.android.a3dmodel.nativelib.CourseOneNative
import javax.microedition.khronos.egl.EGLConfig
import javax.microedition.khronos.opengles.GL10

class DrawTriangleRenderer : Renderer {
    override fun onSurfaceCreated(gl: GL10, p1: EGLConfig) {
        // 设置清除颜色为黑色
        gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
    }

    override fun onSurfaceChanged(gl: GL10, width: Int, height: Int) {
        gl.glViewport(0, 0, width, height);
    }

    override fun onDrawFrame(p0: GL10?) {
        CourseOneNative.drawTriangle()
    }
}